docker build
SERVICE_DIR=/root/.jenkins/workspace/cicd/target
SERVICE_NAME=helloworld-0.0.1-SNAPSHOT.jarBUILD_ID=dontKillMe
# 每次进程启动前，查询该进程是否已启动。若启动，则干掉
TEMP_PID=`ps -ef | grep -w "$SERVICE_NAME" | grep  "java" | awk '{print $2}'`
if [ "$TEMP_PID" != "" ]; then
   kill -9 $TEMP_PID
fi

# 跳转到构建后目录，指定端口启动 jar 包
cd $SERVICE_DIR
nohup java -jar $SERVICE_NAME &